package com.waimai.app.qa.page;

import java.util.HashMap;
import java.util.List;

import org.openqa.selenium.WebElement;

import com.waimai.app.qa.data.Item;
import com.waimai.app.qa.data.PageObject;

public class PersonalInfoPage implements PageObject{

	
	/**
	    *@type id
	    *@testData 
	    *@locatorValue tab_text
	*/
		public Item tab_text;
		/**
		 *@type id
		 *@testData 
		 *@locatorValue favor_num
		 */
		public Item favor_num;
		/**
		 *@type id
		 *@testData 
		 *@locatorValue myfavor_title
		 */
		public Item myfavor_title;
		
	@Override
	public void init(HashMap<String, Object> items) {
		this.tab_text = (Item) items.get("tab_text");
		this.favor_num = (Item) items.get("favor_num");
		this.myfavor_title = (Item) items.get("myfavor_title");
	}
	
	/**
	 * 
		 * @Description：获取我的tab的页面元素返回
		 * @author：wangwenhui
		 * @time：2017年7月14日下午3:10:28
	 */
	public WebElement getMytab(String str ) {
		List<WebElement> myList = this.tab_text.getWebElementList();
		if(myList.size() > 0) {
			for(int i=0;i<myList.size();i++) {
				if(myList.get(i).getText().equals(str)){
					System.out.println(myList.get(i).getText()+"-------------");
					
					return myList.get(i);
				}
			}
		}
		return null;
	}

}
